Private mlngAvailVirtual As Long
Private mlngCPUType As Long
Private mlngNumCPU As Long
This code retrieves three types of information for filling in the properties of the System Information classthe operating system information, the memory and system information, and the Windows directory information. In each of the Property Get procedures of this class, youll find a call to a private method thats responsible for filling in all the properties.
Retrieving the Operating System Version
The OperatingSystem property makes a call to a private method called OSystemGet():
Property Get OperatingSystem() As String
Call OSystemGet OperatingSystem = mstrOS
End Property
The OSystemGet() method fills in the module level variable mstrOS.
The OSystemGet() Method
To retrieve the name of the operating system your application is currently running on, you use the GetVersionEx() Windows API call. This function call fills in the OSVERSIONINFO user-defined type:
Private Sub OSystemGet()
Dim typOS As OSVERSIONINFO
Dim lngWord As Long
If typOS.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS Then
mstrOS = "Windows 95/98"
ElseIf typOS.dwPlatformId = VER_PLATFORM_WIN32_NT Then
mstrOS = "Windows NT"
End If